package me.w70.bot.methods;

import java.util.HashMap;
import java.util.LinkedList;

public class TyperQueue {
	LinkedList queue = new LinkedList();

	// Add work to the work queue
	public synchronized void addWork(HashMap o) {
		queue.addLast(o);
		notify();
	}

	// Retrieve work from the work queue; block if the queue is empty
	public synchronized HashMap getWork() throws InterruptedException {
		while (queue.isEmpty()) {
			wait();
		}
		return (HashMap) queue.removeFirst();
	}

}
